<!DOCTYPE html>
<html lang="en">
<head>
    {{template "pc/public/mycss.html" .}}
</head>
<style type="text/css">
	#wrapper{
		background: #f5f5f5!important;
	}
	.header-center{
		background: #fff;
	}
	.user_left{
		background: #fff;
	}
	.fenlei{
		width: 20%;
	}
	
	@media (max-width: 992px){
		.fenlei{
		    width: 100%;
		}
	}
  .del{position: absolute;right: 20px;top: 20px;cursor: pointer;color: #999}
  .del:hover{color: #e4393c}

  .shopmall ul li {
     position: relative;
  }
</style>
<body class="common-home res layout-home1">
<div id="wrapper" class="wrapper-full banners-effect-7">
	<!-- Header Container  -->
  {{template "pc/public/head.html" .}}
  {{template "pc/public/mytop.html" .}}
	<div class="main-container container">
		<div class="row mb-50">
			<!--Left Part Start -->
			{{template "pc/public/myleft.html" .}}
			<!--Middle Part Start-->
			<div id="content" class="col-md-10 col-sm-8 right mt-15">
				<div class="mycollection myfollow">
					<div class="header">
						<ul>
							<li><a href="/my/collect">关注的商品</a></li>
              <li><a class="on" href="/my/focus">收藏的店铺</a></li>
              <li><a href="/my/foot">浏览历史</a></li>
						</ul>
						<div>
              <form action="/my/focus">
              <input type="text" name="keywords" placeholder="请输入店铺名称">
              <button>搜索</button>
              </form>
            </div>
					</div>
					<div class="box">
						<!-- <div class="operation">
							<span class="fl"><input id="asd" type="checkbox" name=""></span>
							<b>全选</b>
							<a class="fr" href="javascript:void(0);"><i class="fa fa-shopping-cart"></i><em>取消关注</em></a>
						</div> -->
            <script type="text/javascript">
              console.log({{.info}})
            </script>
						<div class="shopmall">
              {{if .info}}
							<ul>
                {{range .info}}
								<li id="{{.id}}">
									<div class="clearfix">
										<a href=""><img src="{{.pathname}}"></a>
										<p>
											<span class="overpl1"><a href="/shop?id={{.gid}}" class="dp">{{.name}}</a></span>
											<span class="overpl1">关注人数：{{.num}}</span>
                      {{if eq .gid "0"}}
                      <span class="overpl1">主营：<a href="/">{{.fw}}</a></span>
                      {{else}}
											<span class="overpl1">主营：{{range .fw}}<a href="/column?cid={{.id}}">{{.name}}</a>&nbsp;&nbsp;{{end}}</span>
                      {{end}}
										</p>
										<div class="mt-30">
											销量<span class="mr-20">{{.sellnum}}</span>  共<span>{{.pnum}}</span>件宝贝
											<!-- <div class="mask">
												<span><input class="selected" type="checkbox" onclick="selected(this)" name="test"></span>
												选择
											</div> -->
										</div>
									</div>
									<div class="shop-products">
                    {{range .product}}
										<a href="/product/content?id={{.id}}">
											<img src="{{.pathname}}">
											<p>￥{{if .vprice}}{{.vprice}}{{else}}{{.price}}{{end}}</p>
										</a>
                    {{end}}
									</div>
                  <div class="del">取消关注</div>
								</li>
                {{end}}
							</ul>
              {{else}}
              <!-- 默认图 -->
              {{end}}
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<!-- Footer Container -->
{{template "pc/public/foot.html" .}}
{{template "pc/public/myfoot.html" .}}
</body>
</html>
<script type="text/javascript">
	var $typeheader = 'header-home1';

	$('.order ul li').click(function() {
		$(this).addClass('on');
		$(this).siblings('li').removeClass('on');
	});
</script>
<script type="text/javascript">
  $('.del').click(function(){
      var id=$(this).parent().attr('id')
      wxc.xcConfirm("您确定要取消关注吗?","confirm",{onOk:function(){
        $.ajax({
          url:window.location.href,
          data:{id:id,table:'mt_member_focus'},
          type:'post',
          success:function(res) {
            if(res==1){
              showToast('取消关注成功');
              $('#'+id).remove()
            }else{
              showToast('网络繁忙,请重试');
            }
          }
        })  
      }});
    })



	var chbAll=document.getElementById('asd');
        var chbs=document.querySelectorAll(
            "div span:first-child>input"
    );
    chbAll.onclick=function(){
        if (chbAll.checked) {
            chbAll.parentNode.style.backgroundImage = 'url(../../img/pc/imgs/checked2.png)';
        }else {
            chbAll.parentNode.style.backgroundImage = 'url(../../img/pc/imgs/checked1.png)';
        }
        for(var i=0;i<chbs.length;i++){
            chbs[i].checked=this.checked;
           if (chbs[i].checked) {
            chbs[i].parentNode.style.backgroundImage = 'url(../../img/pc/imgs/checked2.png)';
           }else {
            chbs[i].parentNode.style.backgroundImage = 'url(../../img/pc/imgs/checked1.png)';
           }
        }
    } 
     function selected(e) {
        var inselected =e.parentNode;
        if (e.checked) {
            inselected.style.backgroundImage = 'url(../../img/pc/imgs/checked2.png)';
        }else{
            inselected.style.backgroundImage = 'url(../../img/pc/imgs/checked1.png)';
            chbAll.checked=false;
        }
    }
</script>